<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><s:text name="global.title" /></title>
<script src="../scripts/js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="../scripts/js/jquery-ui-1.8.24.custom.min.js"
	type="text/javascript"></script>
<link href="../scripts/css/blitzer/jquery-ui-1.8.24.custom.css"
	rel="stylesheet" type="text/css" />
<link href="../style.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<s:if test="hasActionErrors()">
		<script type="text/javascript">
			$(function() {
				$('#errorDialog').dialog({
					modal : true
				});
			});
		</script>
	</s:if>
	<s:if test="hasActionMessages()">
		<script type="text/javascript">

			$(function() {
				$('#msgDialog').dialog({
					modal : true,
					open: function(event, ui) {
						$(":button:contains('ตกลง')").hide();
						$(":button:contains('ยกเลิก')").hide();
	    				if( $( this ).text().indexOf('ขนาดและราคา') != -1 )
	            		{
	            			 $(":button:contains('ตกลง')").show();   
	            			 $(":button:contains('ยกเลิก')").show();
	            		}	
					},
					buttons: {
				        "ตกลง": function() {
				        	$('#food_added').submit();
			            	$(this).dialog('close'); 
				        },
				        'ยกเลิก': function() {
				            $(this).dialog('close');
				        }
				    }

				});
			});
		</script>
	</s:if>
	<tiles:insertAttribute name="header" />
	<div id="bodyPan">
		<tiles:insertAttribute name="leftPane" />
		<tiles:insertAttribute name="rightPane" />
	</div>
	<tiles:insertAttribute name="footer" />
</body>
<%@include file="/errorDialog.jsp"%>
<%@include file="/msgDialog.jsp"%>
</html>